<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"  %>
<!DOCTYPE html>

<head>
    <meta charset="utf-8">
    <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
    <title>大乱斗后台</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width">
    <link href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/dld/admin/css/template_main.css">
</head>

<body>
	<jsp:include page="../common/header.jsp"></jsp:include>
        <!--/.navbar-collapse -->
        <div class="templatemo-content-wrapper">
            <div class="templatemo-content">
            	<div class="table-responsive">
		    	<table class="table table-bordered text-center">
					<tr>
						<th>账号</th>
						<th>名称</th>
						<th>性别</th>
						<th>权限</th>
						<th>操作</th>
					</tr>
		     		<s:iterator value="usersList" status="st" var="list">
		    		<tr>
		    			<td><s:property value="#list.getUsername()"/></td>
		    			<td><s:property value="#list.getName()"/></td>
		    			<td><s:property value="#list.getSex()"/></td>
		    			<td><s:property value="#list.getPower()"/></td>
		    			<td>
			    			<button class="btn bt-default" onclick="window.location.href='adminEditUsersMngAction?id=<s:property value="#list.getId()"/>'">修改</button>
			    			<button class="btn bt-default" onclick=" if(confirm('是否确认删除?')){window.location.href='adminDeleteUsersMngAction?id=<s:property value="#list.getId()"/>'} ">删除</button>
		    			</td>
		    		</tr>
		    		</s:iterator>
		    	</table>
		    	</div>
				<s:if test="%{pageBean.currentPage == 1}">
				<div class="btn btn-default" disabled="disabled">第一页</div><div class="btn btn-default" disabled="disabled">上一页</div>
				</s:if>
				<s:else>
					<a href="adminUsersMngAction?page=1" class="btn btn-info">第一页</a>
					<a href="adminUsersMngAction?page=<s:property value="%{pageBean.currentPage-1}"/>" class="btn btn-info">上一页</a>
				</s:else>
				<s:if test="%{pageBean.currentPage != pageBean.totalPage}">
					<a href="adminUsersMngAction?page=<s:property value="%{pageBean.currentPage+1}"/>" class="btn btn-info">下一页</a>
					<a href="adminUsersMngAction?page=<s:property value="pageBean.totalPage"/>" class="btn btn-info">最后一页</a>
				</s:if>
				<s:else>
					<div class="btn btn-default" disabled="disabled">下一页</div> <div class="btn btn-default" disabled="disabled">最后一页</div>
				</s:else>
				 共<s:property value="pageBean.allRow"/> 条记录
				共<s:property value="pageBean.totalPage"/> 页
				 当前第<s:property value="pageBean.currentPage"/>页
		    	<button class="btn btn-info pull-right" onclick="window.location.href='adminAddUsersMngAction'">添加</button>
            </div>
        </div>
    <jsp:include page="../common/footer.jsp"></jsp:include>
    <script src="http://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script src="/dld/admin/js/template_js.js"></script>
    <script>
    function search(){
    	var like = $('#templatemo_search_box').val();
    	window.location.href = "adminUsersMngAction?page=1&like=" + like;
    }
    </script>
</body>

</html>